<%@page import="org.tailor.Cuff"%>
<html>
<head>

<meta name="layout" content="mainLayout" />
<g:set var="entityName"
	value="${message(code: 'shirt.label', default: 'Shirt')}" />

	
</head>
<body>
	<div id="col_middle">
	
	<h1>
			<g:message code="default.create.label" args="[entityName]" />
		</h1><br/>
		<g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
		<g:form  method="post" controller="shirt" action="save" enctype="multipart/form-data">
			<div class="dialog">
				<table>
					<tbody>
						<tr class="prop">
							<td valign="top" class="name">
								<label for="shirtID">
									<g:message code="shirt.shirtID.label" default="Shirt ID" />
								</label>
							</td>
							<td valign="top" class="value ${hasErrors(bean: shirtInstance, field: 'shirtID', 'errors')}">
								<g:textField name="shirtID" value="${fieldValue(bean: shirtInstance, field: 'shirtID')}" />
							<br/><br/>
							</td>
						
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="designName">
							    <g:message	code="shirt.designName.label" default="Design Name" /></label>
							   
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: shirtInstance, field: 'designName', 'errors')}">
								<g:textField name="designName" value="${shirtInstance?.designName}" />
								<br/><br/>
							</td>
						</tr>
						<tr class="prop">
							<td valign="top" class="name"><label for="designPicture"><g:message
										code="shirt.designPicture.label" default="Design Picture" />
							</label></td>
							<td valign="top"
								class="value ${hasErrors(bean: shirtInstance, field: 'designPicture', 'errors')}">
                                <input type="file"  name="designPicture"  id="designPicture" size="10" />                  

							    <br/><br/>							
							</td>
						</tr>
						

						<tr class="prop">
							<td valign="top" class="name"><label for="collar">
							   <g:message code="shirt.collar.label" default="Collar" /></label>
						   </td>
							<td valign="top"
								class="value ${hasErrors(bean: shirtInstance.collar, field: "collarName", 'errors')}">
								
								
								
								<g:select name="collar.id" from="${org.tailor.Collar.list()}"
									optionKey="id" optionValue="collarName" />
									
									 <br/><br/>	</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="cuff">
							<g:message	code="shirt.cuff.label" default="Cuff" /></label>
							</td>
							<td valign="top" class="value ${hasErrors(bean: shirtInstance, field: "cuff", 'errors')}">

                              <g:select
							 name="cuff.id"
							from="${org.tailor.Cuff.list()}" optionValue="cuffName"
							optionKey="id" />  

<%--								<g:select name="cuff.id" from="${org.tailor.Cuff.list()}"--%>
<%--									optionKey="id" value="${shirtInstance?.cuff?.id}" />--%>
							     <br/><br/>
							</td>
						</tr>
						
						 <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="fabric"><g:message code="shirt.fabric.label" default="fabric" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: shirtInstance, field: 'fabric', 'errors')}">
                                    <g:select name="fabric.id" from="${org.tailor.Fabric.list()}" optionKey="id"  optionValue="fabricName" />
                                  <br/><br/>
                                </td>
                            </tr>
                        

						
						<tr class="prop">
							<td valign="top" class="name"><label for="monoText"><g:message
										code="shirt.monoText.label" default="Mono Text" />
							</label></td>
							<td valign="top"
								class="value ${hasErrors(bean: shirtInstance, field: 'monoText', 'errors')}">
								<g:textField name="monoText"
									value="${fieldValue(bean: shirtInstance, field: 'monoText')}" />
							     <br/><br/>
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="monogram"><g:message
										code="shirt.monogram.label" default="Monogram" />
							</label></td>
							<td valign="top"
								class="value ${hasErrors(bean: shirtInstance, field: 'monogram', 'errors')}">
								<g:select name="monogram.id"
									from="${org.tailor.Monogram.list()}" optionKey="id"
									optionValue="monogramID" />
									<br/><br/>
									</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="note"><g:message
										code="shirt.note.label" default="Note" />
							</label></td>
							<td valign="top"
								class="value ${hasErrors(bean: shirtInstance, field: 'note', 'errors')}">
								<g:textField name="note" value="${shirtInstance?.note}" />
								<br/><br/>
								</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="otherAddOn"><g:message
										code="shirt.otherAddOn.label" default="Other Add On" />
							</label></td>
							<td valign="top"
								class="value ${hasErrors(bean: shirtInstance, field: 'otherAddOn', 'errors')}">
								<g:select name="otherAddOn.id"
									from="${org.tailor.OtherAddOn.list()}" optionKey="id"
									optionValue="addOnName" />
									<br/><br/>
									</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="pocketType"><g:message
										code="shirt.pocketType.label" default="Pocket Type" />
							</label></td>
							<td valign="top"
								class="value ${hasErrors(bean: shirtInstance, field: 'pocketType', 'errors')}">
								<g:textField name="pocketType"
									value="${fieldValue(bean: shirtInstance, field: 'pocketType')}" />
							    <br/><br/>
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="rating"><g:message
										code="shirt.rating.label" default="Rating" />
							</label></td>
							<td valign="top"
								class="value ${hasErrors(bean: shirtInstance, field: 'rating', 'errors')}">
								<g:select name="rating.id" from="${org.tailor.Rating.list()}"
									optionKey="id" optionValue="score" />
								<br/><br/>	
									</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="shirtBack"><g:message
										code="shirt.shirtBack.label" default="Shirt Back" />
							</label></td>
							<td valign="top"
								class="value ${hasErrors(bean: shirtInstance, field: 'shirtBack', 'errors')}">
								<g:textField name="shirtBack"
									value="${shirtInstance?.shirtBack}" />
								<br/><br/>	
									</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="shirtFront"><g:message
										code="shirt.shirtFront.label" default="Shirt Front" />
							</label></td>
							<td valign="top"
								class="value ${hasErrors(bean: shirtInstance, field: 'shirtFront', 'errors')}">
								<g:textField name="shirtFront"
									value="${shirtInstance?.shirtFront}" />
								<br/><br/>	
									</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="shirtName"><g:message
										code="shirt.shirtName.label" default="Shirt Name" />
							</label></td>
							<td valign="top"
								class="value ${hasErrors(bean: shirtInstance, field: 'shirtName', 'errors')}">
								<g:textField name="shirtName"
									value="${shirtInstance?.shirtName}" />
									<br/><br/>
									</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="shoulderFit"><g:message
										code="shirt.shoulderFit.label" default="Shoulder Fit" />
							</label></td>
							<td valign="top"
								class="value ${hasErrors(bean: shirtInstance, field: 'shoulderFit', 'errors')}">
								<g:textField name="shoulderFit"
									value="${shirtInstance?.shoulderFit}" />
									<br/><br/>
									</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="tailor"><g:message
										code="shirt.tailor.label" default="Tailor" />
							</label></td>
							<td valign="top"
								class="value ${hasErrors(bean: shirtInstance, field: 'tailor', 'errors')}">
								<g:select name="tailor.id" from="${org.tailor.Tailor.list()}"
									optionKey="id" value="${shirtInstance?.tailor?.id}" />
						           <br/><br/>
									</td>
						</tr>

					</tbody>
				</table>
			</div>
			<div class="buttons">
				<span class="button"><g:submitButton name="create"
						class="save"
						value="${message(code: 'default.button.create.label', default: 'Create')}" />
				</span>
			</div>
		</g:form>
	</div>
</body>
</html>